Generalized signal averaging